<extend name="Include:mother" />

<block name="content">

<div class="clearfix">
    <div class="float-left">
        <div class="u-breadcrumb">
            <a class="back" href="javascript:window.location.reload()" ><span class="fa fa-repeat"></span> 刷新</a>
            <span class="name">链接组</span>
        </div>
    </div>
    <div class="float-right">
        <a href="#" role="button" class="btn btn-primary btn-sm" onclick="return alert_win();"><i class="fa fa-plus"></i> 新增链接组</a>
    </div>
</div>
<div class="h10"></div>

<table class="table table-bb">
    <tr>
        <th width="30">
            <div class="custom-control custom-checkbox">
                <input type="checkbox" class="custom-control-input checkbox-all" id="checkbox-0">
                <label class="custom-control-label"  for="checkbox-0"></label>
            </div>
        </th>
        <th width="40">ID</th>
        <th width="30%">分类名（链接数）</th>
        <th>宽度(px)</th>
        <th>高度(px)</th>
        <th>排序</th>
        <th>操作</th>
    </tr>
    <volist name='list' id='vo'>
    <tr class="tr_{$vo.id}">
        <td>
            <div class="custom-control custom-checkbox">
                <input type="checkbox" class="custom-control-input checkbox-item" id="checkbox-{$vo.id}" value="{$vo.id}" data-print-url="{:U('GoodsOrderPrint/print_view',array('id'=>$vo['id']))}" data-id="{$vo.id}">
                <label class="custom-control-label"  for="checkbox-{$vo.id}"></label>
            </div>
        </td>
        <td>{$vo.id}</td>
        <td><a class="blue" href="{:U('Ad/index')}?cate_id={$vo.id}">{$vo.name}</a>({$vo.total})</a></td>
        <td>{$vo.width}</td>
        <td>{$vo.height}</td>
        <td>
            <div class="form-inline">
                <input class="form-control form-control-sm w-40" type="text" name="sort" value="{$vo.sort}" old-sort="{$vo.sort}" data-id="{$vo.id}" sort-id="{$vo.id}" />&nbsp;
                <a class="blue" href="#" onclick="return sort_one('AdCate',{$vo.id})">更新</a>
            </div>
        </td>
        <td>
            <a class="btn btn-sm btn-outline-secondary" href="{:U('AdCate/edit',array('id'=>$vo['id']))}" role="button"><i class="fa fa-edit"></i> 编辑</a>
            <div class="btn-group" role="group">
                <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                    更多
                </button>
                <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
                    <a class="dropdown-item" href="#" onclick="return del_one('AdCate','{$vo.id}')"><i class="fa fa-trash"></i> 删除</a>
                </div>
            </div>
        </td>
    </tr>
    </volist>
</table>

<div>
    <button type="button" class="btn btn-secondary btn-sm" onclick="return sort_all('AdCate');"><i class="fa fa-sort"></i> 排序</button>
</div>


<notempty name="pages">
    <div class="h10"></div>
    <div class="g_pages"><div class="in">{$pages}</div></div>
</notempty>

<!--新增分类-->
<div id="as" style="display: none;">
    <form action="{:U('AdCate/add')}" method="post">
        <input name="id" type="hidden" value="">
        <div class="form-group">
            <label><span class="text-danger">* </span>分类名称</label>
            <input type="text" class="form-control" name="name" placeholder="分类名称">
            <small class="form-text text-muted">1-20个字符</small>
        </div>
        <div class="form-group">
            <label>宽度</label>
            <input type="text" class="form-control" name="width" placeholder="宽度">
            <small class="form-text text-muted">内容为图片时填写</small>
        </div>
        <div class="form-group">
            <label>高度</label>
            <input type="text" class="form-control" name="height" placeholder="高度">
            <small class="form-text text-muted">内容为图片时填写</small>
        </div>
        <div class="form-group">
            <label>排序</label>
            <input type="text" class="form-control" name="sort" placeholder="排序" value="500">
            <small class="form-text text-muted">值小靠前，默认500</small>
        </div>
        <div class="h10"></div>
        <div class="text-center">
            <button type="submit" class="btn btn-primary">新增</button>
        </div>
    </form>
</div>

<script>

    //弹出创建分类窗口
    function alert_win(){
        $boot.win({id:'#as','title':'新增分类'});
        return false;
    }

</script> 


</block>
